package com.pzh.logistics.exception;

/**
 * @author E10S
 */

public enum ResultEnum {

    SUCCESS(0, "成功"),

    CHECK_ULTRA_VIRES(300+1, "禁止越权操作"),
    PARAM_ERROR(300+2, "参数错误"),
    UNLOGIN(300+3, "未登录"),
    UNAUTH(300+4, "未校验"),

    //用户相关的报错（100+x)
    USER_NOT_EXIST(100+1, "用户不存在"),
    USERNAME_REPEAT(100+2, "用户已存在"),
    USER_CHECK_ERROR(100+3, "用户校验失败"),
    PHONE_REPEAT(100+4, "手机号已存在"),
    USER_INACTIVE(100+5, "用户未启用"),

    ADDRESS_NOT_EXIST(100+6, "地址不存在"),
    //订单相关错误（700）
    ORDER_NOT_EXIST(700+1,"订单不存在"),
    ORDER_HAS_PAID(700+2, "订单已支付"),
    ORDER_NOT_PAID(700+3, "订单未支付"),


    UNKNOW_ERROR(500, "未知错误"),
    ;

    private Integer code;

    private String message;

    ResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

    public Integer getCode() {
        return code;
    }
}

